import { createRouter, createWebHistory } from 'vue-router'
import Login from '../components/Login.vue'
import Index from '../components/Index.vue'
import Introduce from '../components/Introduce.vue'
import ChatRoom from '../components/ChatRoom.vue'
import Reserve from '../components/Reserve.vue'
import LiveChatroom from '@/components/LiveChatroom.vue'
import ProjectList from '@/components/ProjectList.vue'
import ProjectAll from '@/components/ProjectAll.vue'
import StudentInfo from '@/components/StudentInfo.vue'
import Jump from '@/components/Jump.vue'
import ReserveTeacher from '@/components/ReserveTeacher.vue'
import ProjectListTeacher from '@/components/ProjectListTeacher.vue'
import TeacherInfo from '@/components/TeacherInfo.vue'
import AdminIndex from '@/components/AdminIndex.vue'
import TeacherList from '@/components/TeacherList.vue'
import StudentList from '@/components/StudentList.vue'
import Projects from '@/components/Projects.vue'
import Notice from '@/components/Notice.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Login
    },
    {
      path: '/index',
      component: Index,
      redirect: "/index/introduce",
      children: [
        {
          path: "introduce",
          component: Introduce
        },
        {
          path: "chatroom",
          component: ChatRoom
        }, {
          path: "stuReserve",
          component: Reserve
        }, {
          path: "teaReserve",
          component: ReserveTeacher
        },
        {
          path: "liveChatroom",
          component: LiveChatroom
        },
        {
          path: "projectAll",
          component: ProjectAll,
        },
        {
          path: "projectList",
          component: ProjectList,
        },
        {
          path: "projectListTeacher",
          component: ProjectListTeacher
        },
        {
          path: "stuinfo",
          component: StudentInfo
        },
        {
          path: "teainfo",
          component: TeacherInfo
        },
        {
          path: "jump",
          component: Jump
        }
      ]
    },
    {
      path: "/adminIndex",
      component: AdminIndex,
      children: [
        {
          path: "studentsList",
          component: StudentList,
          children: [
            {
              path: "stuInfo",
              component: StudentInfo
            }
          ]
        },
        {
          path: "teachersList",
          component: TeacherList,
          children: [
            {
              path: "teaInfo",
              component: TeacherInfo
            }
          ]
        },
        {
          path: "projectsList",
          component: Projects
        },
        {
          path: "notice",
          component: Notice
        }
      ]
    }
  ]
})

export default router
